package net.neimeng.luculent.coremodel.datamodel.http;

import android.util.Log;

import com.blankj.utilcode.util.ToastUtils;

import net.neimeng.luculent.coremodel.utils.LoadingDialog;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * BaseObserver
 * Created by jaycee on 2017/6/23.
 */

/**
 *  RXjava 框架的  Observer
 * @param <T>
 */
public abstract class RXObserver<T extends Result> implements Observer<T> {

    private static final String TAG = "RXObserver";

    @Override
    public void onError(Throwable e) {
        LoadingDialog.cancelAll();
        ToastUtils.showShort("网络请求异常，请稍后重试");
        Log.e(TAG, "onError:" +e.toString());
    }

    @Override
    public void onComplete() {
        LoadingDialog.cancelAll();
        Log.d(TAG, "onComplete");
    }

}
